package spring.security.validator;

import java.util.List;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import org.springframework.beans.factory.annotation.Autowired;

import spring.security.dto.PageList;
import spring.security.entity.SysUser;
import spring.security.service.UserService;

public class MyConstraintValidator implements ConstraintValidator<MyConstraint, Object> {

	@Autowired
	private UserService userService;
	
	@Override
	public void initialize(MyConstraint arg0) {
		//初始化TODO
		System.out.println("init");
	}
	
	//arg1 注解值
	@Override
	public boolean isValid(Object arg0, ConstraintValidatorContext arg1) {
		//校验逻辑
		PageList<List<SysUser>> info = userService.getInfo();
		System.err.println(info);
		return false;
	}

	
}
